#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
    int i = 0;
    int j = 0;
    int a, b;

    for (i = 10000; i < 100000; i++)
    {
        int count = 0;
        for (j = 10; j < 10001; j = j * 10)
        {
            a = i / j;
            b = i % j;
            count = count + a * b;

        }
        if (count == i)
            printf("%d ", i);

    }


    return 0;
}